﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Bit.Art.Core
{
    public static class Constants
    {
        /// <summary>
        /// 交易对禁用或者不支持
        /// </summary>
        public static readonly Guid MARKET_NOT_ENABLED = Guid.Parse("00000000-0000-0000-0000-000000000010");

        /// <summary>
        /// 无法解析交易对
        /// </summary>
        public static readonly Guid MARKET_FORMAT_ERROR = Guid.Parse("00000000-0000-0000-0000-000000000011");

        /// <summary>
        /// 无法解析交易对
        /// </summary>
        public static readonly Guid SERVER_ERROR = Guid.Parse("00000000-0000-0000-0000-000000000020");

        /// <summary>
        /// 成功的消息
        /// </summary>
        public static readonly byte[] SUCCESS_MSG = new byte[] { 0 };

        public static readonly byte[] FAIL_MSG = new byte[] { 50 };


        /// <summary>
        /// 连接到SSO API的节点消息
        /// </summary>
#if STAGING
        public readonly static string SsoApiServerEndpoint = "tcp://SsoApiServer:20000";
#else
        public readonly static string SsoApiServerEndpoint = "tcp://SsoApiServer:10000";
#endif

        public static class ErrorCodes
        {
            /// <summary>
            /// 字段值为空
            /// </summary>
            public const int EMPTY_FIELD_VALUE = 100001;

            /// <summary>
            /// 字段值超过界限
            /// </summary>
            public const int FIELD_VALUE_OUT_OF_RANGE = 100002;

            /// <summary>
            /// 无法创建新用户
            /// </summary>
            public const int CREARE_NEW_USER_FAILED = 100003;

            /// <summary>
            /// 无法更新用户信息
            /// </summary>
            public const int UPDATE_USER_INFO_ERROR = 100004;

            /// <summary>
            /// 参数错误
            /// </summary>
            public const int ARGUMENT_ERROR = 100005;

            /// <summary>
            /// 服务器内部错误
            /// </summary>
            public const int SERVER_ERROR = 100006;

            /// <summary>
            /// 未预料的错误
            /// </summary>
            public const int UNFORESEEN_ERROR = 100007;

            /// <summary>
            /// 仅仅代表成功的通用错误码
            /// </summary>
            public const byte SUCCESS = 0;

            /// <summary>
            /// 仅仅代表失败的通用错误码
            /// </summary>
            /// byte类型的错误码都是服务器内部使用的错误码！
            public const byte FAILED = 1;

            /// <summary>
            /// 交易对已经存在
            /// </summary>
            public const byte MARKET_EXISTS = 2;

            /// <summary>
            /// 交易对不存在
            /// </summary>
            public const byte MARKET_NOT_EXISTS = 3;
        }
    }
}
